require 'yaml'

class EasyLogin

   def initialize(username, password)
      configFile = YAML::load_file 'dfc.yaml'
      require configFile['classpath']

      docbase_name = configFile["docbase"]
      clientx = com.documentum.com.DfClientX.new
      localclient = clientx.getLocalClient
      logininfo = clientx.getLoginInfo
      logininfo.setUser username
      logininfo.setPassword password
      @clientX = clientx
      @sess = localclient.newSession docbase_name, logininfo
   end

   def getSession
      @sess
   end

   def getClientX
      @clientX
   end
end


#sessMgr = localclient.newSessionManager